/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1659752507039_718';

  // add your middleware config here
  config.middleware = [];


  /* 取消安全证书验证 */
  config.security = {
    csrf: {
      enable: false,
    },
    domainWhiteList: [ '*' ], // 白名单
  };

  config.sequelize = {
    dialect: 'mysql',
    host: 'localhost',
    port: 3306,
    database: 'eggjs',
    username: 'root',
    password: '111',
  };

  config.cors = {
    credentials: true,
    origin: '*', // 允许任何跨域，若只允许个别IP跨域，则：origin:['http://localhost:8080']
    allowMethods: 'GET,PUT,POST,DELETE', // 被允许的请求方式
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  config.passportJwt = {
    secret:'wjx99',
  };

  return {
    ...config,
    ...userConfig,
  };
};
